// Mine.h

#ifndef MINE_H
#define MINE_H

/**
* Class representing a square, that can be either a
* mine or a "number".
*/
class Mine
{
public:
	/**
	* Constructor. Initialize it to empty.
	*/
	Mine();

	/**
	* Destructor.
	*/
	~Mine();

	/**
	* Sets the square as a mine or not.
	*
	* @param turnIntoMine if to turn the square into a mine or not
	*/
	void setAsMine( const bool turnIntoMine );

	/**
	* Checks if the square is a mine.
	*
	* @return bool if the square is a mine
	*/
	bool isMine() const;

	/**
	* Sets the adjacent number.
	*
	* @param number the new adjacent number
	*/
	void setAdjacentNumber( const int number );

	/**
	* Returns the adjacent number.
	*
	* @return int the number of adjacent mines.
	*/
	int getAdjacentNumber() const;

	/**
	* Sweeps the mine.
	*/
	void sweep();

	/**
	* Checks if the mine has been swept.
	*
	* @return bool the swept value.
	*/
	bool isSwept() const;

	/**
	* Flags the mine.
	*/
	void flag();

	/**
	* Checks if the mine has been flagged.
	*
	* @return bool the flagged value.
	*/
	bool isFlagged() const;

	/**
	* Increases the adjacent number if not a mine by one.
	*/
	void incrementAdjacentNumber();

	/**
	* Resets the flags on the mine.
	*/
	void resetFlags();

	/**
	* Resets the flags and states of the mine.
	*/
	void resetFlagsAndStates();

private:
	// Keeps track if the mine has been swept or not.
	bool swept;

	// Keeps track if the mine has been swept or not.
	bool flagged;

	// Keeps track of the square being a mine or not.
	bool isAMine;

	// Keeps track of the adjacent number of mines.
	int adjacentMines;
};

#endif // MINE_H
